/*
 * Copyright (c) 2006-2020, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-03-19     78677       the first version
 */

#include "main.h"

static struct rt_thread spi_thread;
ALIGN(RT_ALIGN_SIZE)
static rt_uint8_t spi_thread_stack[1024];

static void Spi_Thread_Entry(void *parm);


void Spi_Thread_Entry(void *parm){
    lcd7735_ini();
    lcd7735_fillrect(0,0,160,128,BLACK);
    rt_thread_mdelay(1000);
    lcd7735_putstr(80,0,"HELLO RT-THREAD",WHITE,BLACK);
    while(1){
        rt_thread_mdelay(1000);
    }
}

int Spi_Init(void){
    rt_thread_init(&spi_thread, "spi_thread", Spi_Thread_Entry, RT_NULL,
            &spi_thread_stack[0], sizeof(spi_thread_stack), 10, 10);

    rt_thread_startup(&spi_thread);
    return 0;
}

INIT_APP_EXPORT(Spi_Init);
